#pragma once

#include "NetworkTransmitter.hpp"
#include "camera_type.h"
#include <memory>
#include <vector>
class TransmitterManager {
  public:
    TransmitterManager();
    ~TransmitterManager();

    bool initializeTransmitters(int cameraId, const std::vector<TransportConfig> &configs);
    int sendData(int cameraId, int channelId, const NetworkFrameData &frameData);
    void destroyTransmitters(int cameraId);
    NetworkTransmitter *getTransmitter(int cameraId, CameraTranDirectionE_t direction);

  private:
    struct TransmitterInstance {
        std::unique_ptr<NetworkTransmitter> transmitter;
        TransportConfig config;

        TransmitterInstance(std::unique_ptr<NetworkTransmitter> t, const TransportConfig &c)
            : transmitter(std::move(t)), config(c) {}
    };

    std::vector<std::vector<TransmitterInstance>> m_transmitters;
};